package com.best.smart.log;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;

public class VPNLog {

    public static boolean wtf = false;

    public static boolean open = true;

    public static void initLog(Context context) {
        //SharedPreferences sp = context.getApplicationContext().getSharedPreferences("log", Context.MODE_PRIVATE);
        //wtf = sp.getBoolean("wtf", false);
        Logger.addLogAdapter(new AndroidLogAdapter());
        //if (wtf){
        Logger.addLogAdapter(new FileLoggerAdapter(context));
        //}

// 在应用的初始化代码中设置Logger
        //Logger.addLogAdapter(new FileLogAdapter(context));
    }

    public static void e(String info) {
        if (!open) {
            return;
        }
        Logger.e(info);
    }

    public static void event(String info) {
        if (!open) {
            return;
        }
        Logger.i("upload event:"+info);
    }
}
